# -*- coding : utf_8 -*-
"""
=======================================
Time : 2025/4/7 17:18
Author : 田霄汉
Email : 522989570@qq.com
File : pandas_class01.py
Project : pandas_demo
Function : 初识DataFrame
=======================================
"""
import os
from config.setting import file_path
import pandas as pd

excel01_path = os.path.join(file_path['excel_path'], 'excel01.xlsx')

# 初始化DataFrame
df = pd.DataFrame({'ID': [1, 2, 3], 'NAME': ['John', 'David', 'Heaven'], 'AGE': [24, 25, 26]})
# ID设置为索引
df = df.set_index('ID')
# 创建excel01文件
df.to_excel(excel01_path)
print('Done!')
